$(document).ready(function () {
	$(".popup-forgotpassword .left_inner .msg, .popup-forgotpassword .right_inner .msg").addClass("hidden");
	$(".popup-forgotpassword .left_inner .form_forgot button").click(function () {
		var form_data = {					
				email: $(".popup-forgotpassword .left_inner .form_forgot input").val(),					
				type: "forget_username"
			};		
		$.ajax({			
			type: "POST",			
			url: "ajax_forgot_password",			
			data: form_data,			
			dataType: "json",			
			success: function(response)			
			{				
				$(".popup-forgotpassword .left_inner .msg .txt").html(response.message);
				$(".popup-forgotpassword .left_inner .msg").removeClass("hidden");
				$(".popup-forgotpassword .left_inner .form_forgot").addClass("hidden");
			}
		});		
	});
	
	$(".popup-forgotpassword .right_inner .form_forgot button").click(function () {
		var form_data = {
				email: $(".popup-forgotpassword .right_inner .form_forgot input").val(),
				type: "forget_password"
			};
		$.ajax({
			type: "POST",
			url: "ajax_forgot_password",
			data: form_data,
			dataType: "json",
			success: function(response)
			{				
				$(".popup-forgotpassword .right_inner .msg .txt").html(response.message);
				$(".popup-forgotpassword .right_inner .msg").removeClass("hidden");;
				$(".popup-forgotpassword .right_inner .form_forgot").addClass("hidden");
			}
		});
	});
	
	$(".popup-forgotpassword .left_inner .msg button").click(function () {
		$(".popup-forgotpassword .left_inner .msg").addClass("hidden");
		$(".popup-forgotpassword .left_inner .form_forgot").removeClass("hidden");
	});
	
	$(".popup-forgotpassword .right_inner .msg button").click(function () {
		$(".popup-forgotpassword .right_inner .msg").addClass("hidden");
		$(".popup-forgotpassword .right_inner .form_forgot").removeClass("hidden");
	});
});